package com.ocom.websocket.feign;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.dto.Department;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(value = "human")
public interface HumanClientService {
    /**
     * 获取部门列表
     * @param comID 单位编号
     * @param deptID 部门编号
     * */
    @GetMapping(HumanServiceUrl.URL_Department_GetDeptInfo)
    public Result GetDeptInfo(@RequestParam("comID") Long comID,@RequestParam("deptID")  Long deptID,
                              @RequestParam("deptName")String deptName);


    /***
     * 新增部门
     * @param map 对象
     */
    @PostMapping(HumanServiceUrl.URL_Department_AddDeptInfo)
    public Result AddDeptInfo(@RequestBody Map<String, Object> map);

    /**修改部门*/
    @PostMapping(HumanServiceUrl.URL_Department_UpdateDept)
    public Result UpdateDept(@RequestBody Map<String, Object> map);


    /**删除部门*/
    @PostMapping(HumanServiceUrl.URL_Department_DelDept)
    public Result DelDept(@RequestBody Map<String, Object> map);


    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody Map<String, Object> map);


    /**
     * 新增人员信息
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelAddPerson)
    public Result AddPerson(@RequestBody Map<String, Object> map);


    /**修改人员信息*/
    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@RequestBody Map<String, Object> map);

    /**
     * 获取人员信息 getPersonInfo
     * */
    @GetMapping(HumanServiceUrl.URL_GetPersonInfo)
    public Result GetPersonInfo(@RequestParam("comId") Long comId,@RequestParam("pId")Long pId);

    @PostMapping(HumanServiceUrl.URLP_removePerson)
    Result  removePerson(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId,@RequestParam("userId")Long userId);


    @PostMapping(HumanServiceUrl.URL_GetMngUserInfo)
    public Result getMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_AddMngUserInfo)
    public Result accountPageAdd(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_UpdateMngUserInfo)
    public Result accountPageModify(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_DeleteMngUserInfo)
    public Result deleteMngUserInfo(@RequestBody JSONObject jsonObject);


    //获取下级部门信息（department/getDeptInfos）
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptInfos)
    public Result departmentGetDeptInfos(@RequestBody Department deleteDeptDto);

    //获取部门id（department/getDeptIds）
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptIds)
    public Result getDeptIds(@RequestBody Department department);
}
